package com.liujit.pay.wx.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 资金账户
 * @author: liujun
 * @create: 2021/2/19 2:23 下午
 **/
@Getter
@AllArgsConstructor
public enum RefundsFundsAccount {
    /**
     * 未结算资金
     */
    UNSETTLED("UNSETTLED","未结算资金"),
    /**
     * 可用余额
     */
    AVAILABLE("AVAILABLE","可用余额"),
    /**
     * 不可用余额
     */
    UNAVAILABLE("UNAVAILABLE","不可用余额"),
    /**
     * 运营户
     */
    OPERATION("OPERATION","运营户");

    private String fundsAccount;

    private String name;

    public static String getName(String fundsAccount) {
        for (RefundsFundsAccount refundsFundsAccount : RefundsFundsAccount.values()) {
            if (StrUtil.equals(fundsAccount, refundsFundsAccount.getFundsAccount())) {
                return refundsFundsAccount.getName();
            }
        }
        return null;
    }
}
